/**
 *Copyright(c) HNA SYSTEMS Co., LTD
 *
 *@date 2013-7-23
 * 	
 *Original Author: 郑兴(zhengxing)
 *
 *ChangeLog
 *
 */
package com.hnas.sys.service.system.dto;

import java.io.Serializable;

import com.hnas.sys.domain.PackageStatus;
import com.hnas.sys.domain.ResourceStatus;
import com.hnas.sys.domain.ResourceType;

/**
 * @author 郑兴(zhengxing)
 *
 */
public class DTOResource implements Serializable,Comparable<DTOResource> {
	private long id;
	private String name;
	private String resource;
	private int priority;
	private String description;
	private ResourceType type;
	private ResourceStatus status;
	private Long menuPackageID;
//	private String roles="";//可访问角色列表
	private String packgeName;
	private long[] roleArr;
	
	private int operateType;
	
	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * @return the resource
	 */
	public String getResource() {
		return resource;
	}
	/**
	 * @param resource the resource to set
	 */
	public void setResource(String resource) {
		this.resource = resource;
	}
	/**
	 * @return the priority
	 */
	public int getPriority() {
		return priority;
	}
	/**
	 * @param priority the priority to set
	 */
	public void setPriority(int priority) {
		this.priority = priority;
	}
	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}
	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}
	/**
	 * @return the type
	 */
	public ResourceType getType() {
		return type;
	}
	/**
	 * @param type the type to set
	 */
	public void setType(ResourceType type) {
		this.type = type;
	}
	/**
	 * @return the status
	 */
	public ResourceStatus getStatus() {
		return status;
	}
	/**
	 * @param status the status to set
	 */
	public void setStatus(ResourceStatus status) {
		this.status = status;
	}
	/**
	 * @return the menuPackageID
	 */
	public Long getMenuPackageID() {
		return menuPackageID;
	}
	/**
	 * @param menuPackageID the menuPackageID to set
	 */
	public void setMenuPackageID(Long menuPackageID) {
		this.menuPackageID = menuPackageID;
	}
	
	/*
	 * (non-Javadoc)
	 * @see java.lang.Comparable#compareTo(java.lang.Object)
	 */
	public int compareTo(DTOResource o) {
		if(null != o) {
			if(this.priority < o.priority) {
				return -1;
			} else if(this.priority > o.priority) {
				return 1;
			} else {
				if(this.id< o.id) {
					return -1;
				} else if(this.id > o.id) {
					return 1;
				}
			}
		}
		return 0;
	}
//	public String getRoles() {
//		return roles;
//	}
//	public void setRoles(String roles) {
//		this.roles = roles;
//	}
	public int getOperateType() {
		return operateType;
	}
	public void setOperateType(int operateType) {
		this.operateType = operateType;
	}
	public boolean isValid(){
		return ResourceStatus.VALID.equals(this.status);
	}
	public long[] getRoleArr() {
		return roleArr;
	}
	public void setRoleArr(long[] roleArr) {
		this.roleArr = roleArr;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getPackgeName() {
		return packgeName;
	}
	public void setPackgeName(String packgeName) {
		this.packgeName = packgeName;
	}
}
